package cn.name.ssmbase.controller;

import cn.name.ssmbase.domain.Area;
import cn.name.ssmbase.domain.City;
import cn.name.ssmbase.domain.Province;
import cn.name.ssmbase.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Nominal on 2018/1/25 0025.
 * 微博：@Mr丶Li_Anonym
 */
@RestController
public class AreaController {
    @Autowired
    AreaService areaService;

    @GetMapping("province")
    public List<Province> province(){
        return areaService.findProvince();
    }
    @GetMapping("city")
    public List<City> city(Province province){
        return areaService.findCity(province);
    }
    @GetMapping("area")
    public List<Area> area(City city){
        return areaService.findArea(city);
    }


}
